<%@ page contentType="text/html;charset=UTF-8" %>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>招商银行供应商门户-采购创造价值_商务协同_商务应答_商业机会</title>
<script language="JavaScript" type="text/javascript" src="../javascript/ajaxdeal.js"></script>

</head>
<body >
<span style='width:0px;height:0px;position:absolute;top:0;left:0;filter:alpha(Opacity=50);background-color:white;display:none' id='showbuttomdiv' >
        <span style="width:0px;height:0px;" id="showbuttomdiv1"></span>
    </span>



    <div style="position:absolute;width:250px;height:120px;top:0;left:0;border-style:solid;border-width:1px;
         display:none;background-color:white;
         border-color:black;
         filter:shadow(color='red',direction=45)" id='showtopdiv' >

        <div style="width:250px;height:20px;background-image:url(../images/th_bgc.jpg);" align="right">
       
            <img src='../images/close_over.gif' style='border-width:0px;display:none;cursor:hand' onclick='hideHideFun()' id="closebutton" alt="关闭"/>
        </div>
        <table style='width:250px;height:60px' >
        <tr>
        	<td style='width:60px;height:40px;padding-top:7px' align='center'>
        	
        	<img src='../images/message_dialog.gif' style='border-width:0px;display:none;' id="warnimg"/>
        	<img src='../images/error_dialog.gif' style='border-width:0px;display:none;' id="errorimg" />
        		
        	</td>
        	
        	<td style='width:180px;height:40px;padding-top:7px'>
        	
        	 <div style='font-size:12px;color:black;width:180px;height:50px;overflow:hidden;padding-left:60px;padding-top:12px' id='dealshowmess' >数据处理中,请稍等....</div>
    		 <div>
        	</td>
        	
        </tr>
        </table> 
        <div style='width:100%' align='center'>
   			<img src='../images/loading.gif' style='border-width:0px' id="waitbar"/>
   			<input type='button' value='确  定' id='close_button' style='display:none;height:20px' onclick='hideHideFun()' />
   			<input type='button' value='确  定' id='delete_button' style='display:none;height:20px' onclick='realDFile()' />
   			<input type='button' value='取  消' id='cancel_button' style='display:none;height:20px' onclick='hideHideFun()' />
   		</div>
   
    </div>


	<center>
<div >
		
			
		    <jsp:include page="top.jsp"></jsp:include>
			
			<table style='width:980px' >
			<tr>
			<td style='width:200px align='right'>
			<iframe id="leftframe" scrolling="no" src="left.jsp"
								marginwidth="1" marginheight="1" frameborder="0"  width='200px'
								height='420px'>
			</iframe>
			</td>
			<td style='width:780px' align='left'>		
			
			
			<iframe id="bodyframe"  src="../announcement/index.jsp" scrolling="auto"
								marginwidth="1" marginheight="1" frameborder="0"  width='760px'
								height='420px' align='left'>
			</iframe>

            </td>
            </tr>
		    </table>

			
		  
</div>


<div style="width:1000px;height:25px;margin:0 auto;background-color:#607A90;line-height:25px;color:#ffffff;text-align:center; margin-top:10px">
网站声明 | 友情链接 | 加入收藏夹
</div>
<div style="width:1000px;margin:0 auto;height:35px;line-height:35px;color:#606060;text-align:center;margin-top:10px">
© 2009 招商银行 版权所有ICP许可证号 粤B2-20040497
</div>
</div>


 </center>
 
 <script language="javascript">
 	//关闭浏览器触发的事件
 	window.onbeforeunload = function onunload_handler(){  
 		var n = window.event.screenX - window.screenLeft;   
        var b = n > document.documentElement.scrollWidth-20;   
        if(b || window.event.clientY < 0 || window.event.altKey)   
        {
			//浏览器关闭
			var xhr = ajaxFunction();
			
			xhr.onreadystatechange = function(){
				if(xhr.readyState==4){
					if(xhr.status==200){
						//alert('清除成功');
						//var data = xhr.responseText;		//获取文本
						//document.getElementById("divcheck").innerHTML = data;
					}
				}
			}
			xhr.open("post","../user/exit.do?timeStamp="+new Date().getTime(),false);
			xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
			xhr.send(null);
        }
 	}
 	function ajaxFunction(){
 	   var xmlHttp;
 	   try{ // Firefox, Opera 8.0+, Safari
 	        xmlHttp=new XMLHttpRequest();
 	    }
 	    catch (e){
 		   try{// Internet Explorer
 		         xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
 		      }
 		    catch (e){
 		      try{
 		         xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
 		      }
 		      catch (e){}
 		      }
 	    }
 		return xmlHttp;
 	 }
    function showHideFun(){


        var showbuttomdiv = document.getElementById("showbuttomdiv");
        var showbuttomdiv1 = document.getElementById("showbuttomdiv1");

        var showtopdiv = document.getElementById("showtopdiv");
        var divHeight = document.body.scrollHeight;
		var divWidth = document.body.scrollWidth;
        var margintop = (divHeight-100)/2;
		var marginleft = (divWidth-200)/2;
        
        showbuttomdiv.style.height =divHeight;

        showbuttomdiv.style.width =divWidth;

        showbuttomdiv.style.display = "inline";
        showbuttomdiv1.style.height =divHeight;

        showbuttomdiv1.style.width =divWidth;

        showtopdiv.style.display = "inline";
        showtopdiv.style.top = margintop;
        showtopdiv.style.left = marginleft;

        document.getElementById("waitbar").style.display = "inline";
        
    }

    function hideHideFun(){
          var showbuttomdiv = document.getElementById("showbuttomdiv");
          var showtopdiv = document.getElementById("showtopdiv");
          showbuttomdiv.style.display = "none";
          showtopdiv.style.display = "none";
          var dealshowmess = document.getElementById("dealshowmess");
          dealshowmess.innerHTML = '数据处理中,请稍等....';
          document.getElementById("closebutton").style.display = "none";
          document.getElementById("warnimg").style.display = "none";
		  document.getElementById("errorimg").style.display = "none";
		  document.getElementById("close_button").style.display = 'none';
		  document.getElementById("dealshowmess").style.paddingLeft = '60px';

    }


    function changeShowMessage(message,end,warn,deleteObj,isRed,toFun){

         var dealshowmess = document.getElementById("dealshowmess");
          dealshowmess.innerHTML = message;
          if(end == 'yes'){

			document.getElementById("closebutton").style.display = "inline";
                        document.getElementById("waitbar").style.display = "none";
			}else if(end == 'error'){
			
				document.getElementById("warnimg").style.display = "none";
				document.getElementById("errorimg").style.display = "inline";
				document.getElementById("close_button").style.display = 'inline';
				document.getElementById("cancel_button").style.display = 'none';
				document.getElementById("delete_button").style.display = 'none';
			}
			
			if(warn == 'ok'){
				document.getElementById("warnimg").style.display = "inline";
				document.getElementById("errorimg").style.display = "none";
				document.getElementById("close_button").style.display = 'inline';
				document.getElementById("cancel_button").style.display = 'none';
				document.getElementById("delete_button").style.display = 'none';
				dealshowmess.style.paddingLeft = '20px';
				
			}else if(warn == 'error'){
				document.getElementById("warnimg").style.display = "none";
				document.getElementById("errorimg").style.display = "inline";
				document.getElementById("close_button").style.display = 'inline';
				document.getElementById("cancel_button").style.display = 'none';
				document.getElementById("delete_button").style.display = 'none';
				dealshowmess.style.paddingLeft = '20px';
			}else if(warn == 'delete'){
				document.getElementById("warnimg").style.display = "inline";
				document.getElementById("errorimg").style.display = "none";
				document.getElementById("close_button").style.display = 'none';
				document.getElementById("delete_button").style.display = 'inline';
				document.getElementById("cancel_button").style.display = 'inline';
				
				dealshowmess.style.paddingLeft = '20px';
			}else{
				document.getElementById("warnimg").style.display = "none";
				document.getElementById("errorimg").style.display = "none";
				document.getElementById("cancel_button").style.display = 'none';
				document.getElementById("delete_button").style.display = 'none';
			}
			
			
			if(typeof(deleteObj) == 'function'){
			
				deleteObj();
			}

			if(isRed){

				document.getElementById("close_button").onclick = function(){
					hideHideFun();
					toFun();
					
				};
			}
    }
    
    var deletefile  = new deleteFile();
    function deleteFile(){
    	this.att = null;
    	this.dObject = null;
    }
    

    
    deleteFile.prototype.dFile = function(){
    
 
    	showHideFun();
		changeShowMessage("开始删除附件信息!");
		try{
		var url = "";
		if(deletefile.att.indexOf('lyan') != -1){
			deletefile.att = deletefile.att.substring(0,deletefile.att.length-4);
			//如果含有lyan代表是供应商修改操作进行的附件删除，要先进行附件信息备份再进行删除
			url = "/portal/deletefile.do?type=record&attpk="+deletefile.att;
		}else{
			url = "/portal/deletefile.do?type=1&attpk="+deletefile.att;
		}
		ajax(url,returnFunction);
		}catch(e){
		
				changeShowMessage("处理附件出现问题!",'yes','error');	
		}
		

		//删除附件后返回信息
		function returnFunction(data){
		
		
			if(data == "ok"){
				changeShowMessage("附件删除成功!",'yes','ok');	
				
				
				
				var fileObj = deletefile.dObject;
				
				
				var parentNode = fileObj.parentNode;
				
				var parentNodeNode = parentNode.parentNode;
				parentNodeNode.removeChild(parentNode);
				
			}else{
				changeShowMessage("附件删除失败!",'error');	
			}
		}
    
    }
    
    function realDFile(){
    		deletefile.dFile();
    }

    <%
    
    	String tUrl = request.getParameter("url");
    
    
    	if(tUrl != null && tUrl.trim().length() > 0){
    		tUrl = tUrl.replace('@','?');
    		tUrl = tUrl.replace('-','&');
    	}
    
    %>

    var url = "<%=tUrl%>";
    if(url != "null" && url.length>0 ){
        sendUrl(url,"");
    }
    
    
    
    
 </script>
</body>

</html>